J.ba = J.ba || {};
J.ba.lh = J.P.extend({
    pb: [J.ga, J.Nc],
    AF: ["position", "visible", "clickable", "bubble"],
    o: function(a, b) {
        this.map = b;
        this.Hc(this.AF, a);
        this.D("zIndex", a);
        this.D("draggable", a);
        J.f.dc || J.f.aa ? this.bz() : this.Pn();
        this.hc = a;
        this.hc.ba = this
    },
    draggableChanged: function() {
        this.get("draggable") ? this.On() : this.qo()
    },
    Z: function(a, b) {
        var c;
        c = b ? {
            type: a,
            pixel: b.mb,
            target: this.hc,
            lnglat: b.bi
        }: {
            type: a
        };
        this.hc && this.hc.k(a, c)
    },
    Ma: function(a) { ("click" !== a.type && "rightclick" !== a.type && "dblclick" !== a.type || this.get("clickable")) && this.Z(a.type, a)
    },
    Nn: function() {
        this.c("click", this.Ma);
        this.c("rightclick", this.Ma);
        this.c("dblclick", this.Ma)
    },
    Pt: function() {
        this.A("click", this.Ma);
        this.A("rightclick", this.Ma);
        this.A("dblclick", this.Ma)
    },
    Pn: function() {
        this.get("clickable") && this.Nn();
        this.c("mousemove", this.Ma);
        this.c("mouseout", this.Ma);
        this.c("mouseover", this.Ma);
        this.c("mousedown", this.Ma);
        this.c("mouseup", this.Ma)
    },
    gI: function() {
        this.Pt();
        this.A("mousemove", this.Ma);
        this.A("mouseout", this.Ma);
        this.A("mouseover", this.Ma);
        this.A("mousedown", this.Ma);
        this.A("mouseup", this.Ma)
    },
    clickableChanged: function() {
        this.get("clickable") ? this.Nn() : this.Pt()
    },
    bz: function() {
        this.get("clickable") && this.Nn();
        this.c("touchstart", this.Ma, this);
        this.c("touchmove", this.Ma, this);
        this.c("touchend", this.Ma, this)
    },
    On: function() {
        this.c("dragstart", this.Ch);
        this.c("dragging", this.Ah);
        this.c("dragend", this.Bh)
    },
    Ch: function(a) {
        this.Md = a.mb;
        this.Z("dragstart", a)
    },
    Ah: function(a) {
        var b = a.mb.Ba(this.Md),
            c = b.x,
            b = b.y;
        this.Md = a.mb;
        var d = this.map.get("rotation") * Math.PI / 180;
        this.ig(new J.C(c * Math.cos(d) + Math.sin(d) * b, -Math.sin(d) * c + Math.cos(d) * b));
        this.Z("dragging", a)
    },
    Bh: function(a) {
        this.Z("dragend", a)
    },
    qo: function() {
        this.A("dragstart", this.Ch);
        this.A("dragging", this.Ah);
        this.A("dragend", this.Bh)
    },
    As: function(a) {
        var b, c, d = [];
        b = 0;
        for (c = a.length; b < c; b += 1) d.push(this.$n(a[b]));
        return d
    },
    $n: function(a) {
        a = this.map.zb(a);
        return [a.x, a.y]
    },
    ob: function(a) {
        var b = this.t.ra || this.map.get("centerCoords"),
            c = this.map.get("crs").Ve(Math.floor(this.map.get("zoom")));
        return [(a[0] - b.x) / c, (a[1] - b.y) / c]
    }
});
J.ba.od = J.ba.lh.extend({
    sq: "content icon opacity angle autoRotation offset shadow title label isTop shape topWhenClick topWhenMouseOver".split(" "),
    o: function(a, b) {
        arguments.callee.Ja.apply(this, arguments);
        this.Hc(this.sq, a);
        this.D("move", a);
        this.vC();
        this.Nh();
        this.set("AnimationOffset", new J.C(0, 0));
        this.D("raiseOnDrag", a);
        this.dC = {
            AMAP_ANIMATION_NONE: !1,
            AMAP_ANIMATION_DROP: J.Ff.Easing.Bounce,
            AMAP_ANIMATION_BOUNCE: J.Ff.Easing.Cubic
        };
        this.D("animation", a)
    },
    fo: function(a, b, c) {
        if (this.get("animation") && "AMAP_ANIMATION_NONE" !== this.get("animation")) {
            var d = this;
            this.$e = new J.Ff;
            this.$e.transition = function(c, g, h) {
                if (a && 600 <= h) return d.$e.stop(),
                    0;
                c = 0 === Math.floor(h / 600) % 2 ? "Out": "In";
                "out" === b ? c = "Out": "in" === b && (c = "In");
                return d.dC[d.get("animation")][c](h % 600 / 600)
            };
            c = c || 40;
            this.$e.Ok = function(a) {
                d.set("AnimationOffset", d.so.add(new J.C(0, -1 * c * a)))
            };
            this.so = new J.C(0, 0);
            this.$e.oi()
        }
    },
    AnimationOffsetChanged: function() {
        this.positionChanged()
    },
    zt: function() {
        this.$e && (this.$e.stop(), this.set("AnimationOffset", this.so));
        this.set("AnimationOffset", new J.C(0, -40));
        if (this.Aj) this.Aj.set("position", this.get("position"));
        else {
            var a = new O({
                zIndex: this.get("zIndex") - 1,
                icon: new V({
                    image: J.m.Ka + "/theme/v1.3/dragCross.png",
                    size: new J.Hb(14, 11)
                }),
                offset: new J.C( - 4, -5),
                position: this.get("position")
            });
            a.Y = !0;
            this.Aj = a
        }
        this.Aj.setMap(this.map.Sb)
    },
    us: function() {
        this.set("animation", "AMAP_ANIMATION_DROP", !0);
        this.fo(!0, "in");
        this.Aj.setMap(null)
    },
    animationChanged: function() {
        this.$e && (this.$e.stop(), this.set("AnimationOffset", this.so), this.$e = null);
        var a = this.get("animation");
        a && "AMAP_ANIMATION_NONE" !== a && ("AMAP_ANIMATION_DROP" === a ? this.fo(!0, "in", 100) : this.fo())
    },
    Lf: function() {
        this.Aj && this.Aj.set("position", this.get("position"))
    },
    raiseOnDragChanged: function() {
        this.get("raiseOnDrag") ? (this.c("dragstart", this.zt, this), this.c("dragging", this.Lf, this), this.c("dragend", this.us, this)) : (this.A("dragstart", this.zt, this), this.A("dragging", this.Lf, this), this.A("dragend", this.us, this))
    },
    ig: function(a) {
        var b = this.get("position");
        a = this.map.zb(b).add(a.Mb(this.map.get("resolution")));
        b instanceof J.B ? this.set("position", this.map.qe(a)) : this.set("position", a)
    },
    vC: function() {
        var a = this.get("content"),
            b = this.get("shadow"),
            c = this.get("offset"),
            d = this.get("label"),
            a = a ? this.ju(a, c) : this.Zo(this.get("icon"), c);
        this.set("contentDom", a);
        b && (b = this.lu(b, c), this.set("shadowDom", b));
        d && d.content && this.set("labelDom", this.ku(d.content))
    },
    ku: function(a) {
        var b = document.createElement("div");
        b.className = "amap-marker-label";
        b.innerHTML = a;
        return b
    },
    Nh: function() {
        if (this.map && this.get("position") && !this.t) {
            var a = this.map,
                b = this.map.zb(this.get("position")),
                a = this.t = new J.ge({
                    name: "marker-" + J.e.Cb(this),
                    map: a,
                    ta: new J.R.fd([b.x, b.y])
                });
            a.Ih = this;
            this.D("coords", a, !0);
            a.D("offset", this, !0);
            a.D("isTop", this, !0);
            a.D("zIndex", this, !0);
            a.D("params", this, !0)
        }
    },
    getParams: function() {
        return {
            zIndex: this.get("zIndex"),
            bu: this.get("angle"),
            Og: this.get("contentDom"),
            KE: this.get("labelDom"),
            GG: this.get("shadowDom"),
            opacity: this.get("opacity"),
            title: this.get("title"),
            label: this.get("label"),
            nr: this.get("AnimationOffset"),
            offset: this.get("offset"),
            HE: this.get("isTop"),
            shape: this.get("shape"),
            visible: this.get("visible")
        }
    },
    offsetChanged: function() {
        if (this.t && this.t.H) {
            var a = this.map.zb(this.get("position")).Ba(this.t.U).tb(this.map.get("resolution"));
            this.t.H && (this.t.H.style.left = Math.floor(a.x) + this.get("offset").x + this.get("AnimationOffset").x + "px", this.t.H.style.top = Math.floor(a.y) + this.get("offset").y + this.get("AnimationOffset").y + "px")
        }
    },
    positionChanged: function() {
        if (this.t) {
            var a = this.map.zb(this.get("position"));
            this.set("coords", [a.x, a.y]);
            this.t.H && (a = a.Ba(this.t.U).tb(this.map.get("resolution")), this.t.H.style.left = Math.floor(a.x) + this.get("offset").x + this.get("AnimationOffset").x + "px", this.t.H.style.top = Math.floor(a.y) + this.get("offset").y + this.get("AnimationOffset").y + "px")
        }
    },
    contentChanged: function() {
        if (this.t) {
            this.map.Ab.Bk = !0;
            this.map.Ab.jj.push(this.t);
            this.t.H && this.t.H.removeChild(this.get("contentDom"));
            var a = this.get("content"),
                b = this.get("offset"),
                a = this.ju(a, b);
            this.set("contentDom", a);
            this.t.H && (J.f.Xc && J.e.iepngFix(a), this.t.H.appendChild(a), this.t.Og = a)
        }
    },
    iconChanged: function() {
        if (this.t && this.t.H && !this.get("content")) {
            this.map.Ab.Bk = !0;
            this.map.Ab.jj.push(this.t);
            this.t.H && this.get("contentDom") && this.t.H.removeChild(this.get("contentDom"));
            var a = this.get("icon"),
                b = this.get("offset"),
                a = this.Zo(a, b);
            this.set("contentDom", a);
            this.t.H && (J.f.Xc && J.e.iepngFix(a), this.t.H.appendChild(a), this.t.Og = a)
        }
    },
    shadowChanged: function() {
        if (this.t && this.t.H) {
            var a = this.get("shadowDom");
            this.t.H && a && a.parentNode === this.t.H && this.t.H.removeChild(a);
            if (a = this.get("shadow")) {
                var b = this.get("offset"),
                    a = this.lu(a, b);
                this.set("shadowDom", a);
                this.t.H && this.t.H.appendChild(a)
            }
        }
    },
    titleChanged: function() {
        this.t && this.t.Og && "string" === typeof this.get("title") && this.t.Og && this.get("title") && (this.t.Og.title = this.get("title"))
    },
    labelChanged: function() {
        if (this.t && this.t.H) {
            var a = this.get("label"),
                b = this.t.H;
            if (b && a && a.hasOwnProperty("content")) {
                this.get("labelDom") && b.removeChild(this.get("labelDom"));
                var c = "";
                if (a.content) {
                    var c = this.ku(a.content),
                        d = 0,
                        f = 0;
                    a.offset && (d = a.offset.y + "px", f = a.offset.x + "px");
                    c.style.top = d;
                    c.style.left = f;
                    b.appendChild(c)
                }
                this.set("labelDom", c)
            }
        }
    },
    isTopChanged: function() {
        var a = this.map.Ab.dn,
            b = this.get("isTop"),
            c = this.get("zIndex");
        a ? a === this ? this.t && this.t.H && (this.t.H.style.zIndex = b ? this.map.Ab.vi + 10 : c, this.map.Ab.dn = b ? this: null) : (a.t && a.t.H && (a.t.H.style.zIndex = b ? a.get("zIndex") : this.map.Ab.vi + 10), this.t && this.t.H && (this.t.H.style.zIndex = b ? this.map.Ab.vi + 10 : c), this.map.Ab.dn = b ? this: a) : (this.map.Ab.dn = this, this.t && this.t.H && (this.t.H.style.zIndex = b ? this.map.Ab.vi + 10 : c))
    },
    visibleChanged: function() {
        this.t && this.t.H && (this.get("visible") ? this.t.H.style.display = "block": this.t.H.style.display = "none")
    },
    angleChanged: function() {
        if (this.t && this.t.H) {
            var a = {
                x: -1 * this.get("offset").x,
                y: -1 * this.get("offset").y
            };
            J.a.rotate(this.t.H, this.get("angle") || 0, a)
        }
    },
    zIndexChanged: function() {
        var a = this.get("zIndex");
        if (a > this.map.Ab.vi) {
            this.map.Ab.vi = a;
            var b = this.map.Ab.dn;
            b && b.t && b.t.H && (b.t.H.style.zIndex = a + 10)
        }
        this.t && this.t.H && (this.t.H.style.zIndex = this.get("isTop") ? this.map.Ab.vi + 10 : this.get("zIndex"))
    },
    opacityChanged: function() {
        var a = this.get("contentDom"),
            b = this.get("shadowDom");
        a && J.a.pg(a, this.get("opacity"));
        b && J.a.pg(b, this.get("opacity"))
    },
    ju: function(a) {
        var b;
        b = document.createElement("div");
        b.className = "amap-marker-content";
        "string" !== typeof a ? b.appendChild(a) : (b.innerHTML = a, b.childNodes[0] && !b.childNodes[0].style && (b.style["white-space"] = "pre"));
        J.a.pg(b, this.get("opacity"));
        return b
    },
    Zo: function(a) {
        var b, c, d, f, g, h, k;
        a ? ("string" === typeof a ? (b = a, k = !0) : (b = a.get("image"), d = a.get("size"), f = a.get("imageSize"), c = d.width, d = d.height, f && (g = f.width, h = f.height)), c || (c = 0), d || (d = 0), a = "string" !== typeof a ? a.get("imageOffset") : {
            x: 0,
            y: 0
        }) : (b = J.m.md + "/mark_bs.png", a = {
            x: 0,
            y: 0
        },
            c = 19, d = 33, g = 19, h = 33);
        f = document.createElement("div");
        f.className = "amap-icon";
        f.style.position = "absolute";
        k && !J.f.vc && (f.style.overflow = "inherit");
        c && (f.style.width = c + "px");
        d && (f.style.height = d + "px");
        c = document.createElement("img");
        c.src = b;
        g && h && (c.style.width = g + "px", c.style.height = h + "px");
        c.style.top = a.y + "px";
        c.style.left = a.x + "px";
        J.f.vc && k || f.appendChild(c);
        J.a.pg(J.f.vc && k ? c: f, this.get("opacity"));
        return J.f.vc && k ? c: f
    },
    lu: function(a, b) {
        var c = this.Zo(a, b);
        c.style.zIndex = -1;
        return c
    },
    moveChanged: function() {
        var a = this.get("move");
        if (!1 === a) return this.RG();
        void 0 !== a && ("[object Array]" === Object.prototype.toString.call(a.bi) ? this.bF(a.bi, a.speed, a.oa, a.KC) : this.moveTo(a.bi, a.speed, a.oa))
    },
    moveTo: function(a, b, c) {
        var d = this.get("position");
        a.Ba(d);
        var f = Math.round(a.Tc(d) / 1E3 / b * 36E5);
        if (0 === f) return this.k("moveend");
        this.ve && (this.ve.stop(), this.ve = null);
        this.ve = new J.Ff(d, a);
        c = c ||
            function(a) {
                return a
            };
        this.ve.transition = function(a, b, d) {
            if (d >= f) return b;
            var l = (b.r - a.r) * c(d / f) + a.r;
            a = (b.w - a.w) * c(d / f) + a.w;
            return new J.B(l, a)
        };
        this.ve.Ok = function(b) {
            this.set("position", b);
            b.xb(a) ? (this.ve && (this.ve.stop(), this.ve = null), this.hc.k("moveend"), this.k("moveend")) : this.hc.k("moving")
        };
        this.get("autoRotation") && !J.f.vc && (b = this.vz(d, a), this.set("angle", b));
        this.ve.oi(this)
    },
    RG: function() {
        this.ve && (this.ve.stop(), this.ve = null, this.k("movestop"))
    },
    bF: function(a, b, c, d) {
        function f() {
            g += 1;
            g < a.length ? this.moveTo(a[g], b, c) : (this.Z("movealong"), d ? (g = 1, this.set("position", a[0]), this.moveTo(a[1], b, c)) : this.A("moveend", f, this))
        }
        var g = 0;
        this.set("position", a[0]);
        this.c("moveend", f, this);
        this.c("movestop",
            function() {
                this.A("moveend", f, this)
            },
            this);
        this.moveTo(a[0], b, c)
    },
    vz: function(a, b) {
        var c = this.map,
            d = c.zb(a),
            c = c.zb(b),
            f = 0;
        c.Tc(d);
        var g = c.y - d.y,
            h = c.x - d.x;
        0 !== c.x - d.x ? (f = Math.atan((c.y - d.y) / (c.x - d.x)), 0 <= g && 0 > h ? f = Math.PI + f: 0 > g && 0 >= h ? f = Math.PI + f: 0 > g && 0 <= h && (f = 2 * Math.PI + f)) : f = c.y > d.y ? Math.PI / 2 : 3 * Math.PI / 2;
        return J.e.Se(180 * f / Math.PI, 1)
    }
});
J.ba.ln = J.ba.lh.extend({
    o: function(a, b) {
        arguments.callee.Ja.apply(this, arguments);
        this.D("items", a, !0);
        this.D("content", a, !0);
        this.D("resolution", b);
        this.D("centerCoords", b);
        this.kk = a
    },
    $v: function() {
        this.Ad();
        this.yj();
        this.sg();
        this.map.c("movestart", this.Je, this);
        this.map.c("mapmove", this.Je, this);
        this.map.c("zoomstart", this.Je, this);
        this.map.c("click", this.Je, this);
        this.map.c("closeOverlays", this.Je, this);
        this.map.c("rotate", this.Je, this)
    },
    Je: function() {
        this.kk.map && this.kk.close()
    },
    mapChanged: function() {},
    positionChanged: function() {
        this.sg()
    },
    Ad: function() {
        this.u && (this.u.parentNode && this.u.parentNode.removeChild(this.u), this.u = null);
        var a = J.a.create("div", null, "amap-menu");
        J.h.c(a, "mousedown",
            function(a) {
                J.h.stopPropagation(a)
            },
            this);
        this.u = a;
        this.map.ua.ba.appendChild(this.u)
    },
    yj: function() {
        var a = this,
            b = this.u;
        b.innerHTML = "";
        var c = this.get("content");
        if ("object" === typeof c) b.appendChild(c);
        else if ("string" === typeof c) b.innerHTML = c;
        else if ((c = this.get("items")) && c.length) {
            var d = J.a.create("ul", b, "amap-menu-outer");
            c.sort(function(a, b) {
                return isNaN(a.Gm) || isNaN(b.Gm) ? 0 : a.Gm - b.Gm
            });
            for (b = 0; b < c.length; b += 1)(function(b) {
                var c = b.Ox,
                    h = b.oa,
                    k = J.a.create("li", d);
                k.innerHTML = c;
                J.h.c(k, "click",
                    function() {
                        h.call(k);
                        a.kk.close()
                    },
                    k)
            })(c[b])
        } else this.u.innerHTML = ""
    },
    sg: function() {
        var a = this.map,
            b = this.u;
        if (a && b) {
            var c = a.zb(this.get("position")),
                d = this.get("centerCoords"),
                b = (c.x - d.x) / this.get("resolution"),
                c = (c.y - d.y) / this.get("resolution"),
                a = a.get("size"),
                c = c + a.height / 2,
                b = b + a.width / 2;
            this.u.style.right = "";
            this.u.style.bottom = "";
            this.u.style.left = b + "px";
            this.u.style.top = c + "px"
        }
    },
    jg: function() {
        this.u && (this.map.A("click", this.os, this), this.map.ua.ba.removeChild(this.u), this.kk.Oe = !1, this.u = this.kk.Rd.map = null, this.map.A("movestart", this.Je, this), this.map.A("zoomstart", this.Je, this), this.map.A("click", this.Je, this), this.map.A("closeOverlays", this.Je, this), this.map.A("rotate", this.Je, this))
    },
    visibleChanged: function() {
        this.u && (this.get("visible") ? this.u.style.display = "block": this.u.style.display = "none")
    },
    itemsChanged: function() {
        this.u && this.yj()
    }
});
J.ba.wg = J.ba.lh.extend({
    o: function(a, b) {
        arguments.callee.Ja.apply(this, arguments);
        this.Hc("content position contentU isCustom autoMove showShadow closeWhenClickMap size offset".split(" "), a);
        this.D("resolution", b);
        this.D("centerCoords", b);
        this.D("retainWhenClose", a, !0);
        this.D("display", b);
        a.D("toBeClose", this);
        this.map = b;
        this.Tf = a
    },
    $v: function() {
        this.TC ? this.map.ua.ba.appendChild(this.Aa) : (this.Ad(), this.yj(), this.RC());
        this.fr();
        this.sg();
        this.ds();
        this.TC = !0
    },
    Ad: function() {
        var a = J.a.create("div");
        a.className = "amap-info";
        var b = J.a.create("div", a),
            c = J.a.create("div", a),
            d = J.a.create("div", c);
        a.style.position = "absolute";
        c.style.position = "absolute";
        c.style.bottom = -1 * (this.get("offset").y || 0) + "px";
        c.style.left = (this.get("offset").x || 0) + "px";
        b.style.position = "absolute";
        b.style.bottom = -1 * (this.get("offset").y || 0) + "px";
        b.style.left = (this.get("offset").x || 0) + "px";
        this.Aa = a;
        this.Wb = c;
        this.Yk = b;
        this.td = d;
        this.map.ua.ba.appendChild(this.Aa)
    },
    yj: function() {
        var a = this.get("contentU");
        if (a) {
            var b = this.get("isCustom"),
                c = this.td,
                d = this.Yk;
            c.innerHTML = "";
            var f = null;
            if (b) {
                if ("string" === typeof a) c.innerHTML = a;
                else if (a instanceof Array) for (f = 0; f < a.length; f += 1) c.appendChild(a[f]);
                else c.appendChild(a);
                f = c;
                d.parentNode && d.parentNode.removeChild(d)
            } else {
                f = d = J.a.create("div", c, "amap-info-content amap-info-outer");
                "string" === typeof a ? d.innerHTML = a: d.appendChild(a);
                this.UC = d;
                a = J.a.create("a", this.td, "amap-info-close");
                a.innerHTML = "\\u00d7";
                this.ap = a;
                a.href = "javascript: void(0)";
                J.f.dc ? (J.h.c(a, "touchstart",
                    function(a) {
                        J.h.stop(a)
                    },
                    this), J.h.c(a, "touchend",
                    function(a) {
                        J.h.stop(a);
                        this.Tf.close()
                    },
                    this), J.h.c(a, "click",
                    function(a) {
                        J.h.stop(a);
                        this.Tf.close()
                    },
                    this)) : (J.h.c(a, "mousedown",
                    function(a) {
                        J.h.stop(a)
                    },
                    this), J.h.c(a, "click",
                    function(a) {
                        J.h.stop(a);
                        this.Tf.close()
                    },
                    this));
                if (a = this.get("size", !0)) 0 !== a.width && (d.style.width = a.width + "px"),
                0 !== a.height && (d.style.height = a.height + "px");
                a = J.a.create("div", c, "amap-info-sharp");
                a.style.height = "23px";
                if (J.f.Xc || J.f.Ek) a.style.marginLeft = c.childNodes[0].offsetWidth / 2 - 5;
                this.Yk.style.display = "block"
            }
            c = function(a) {
                J.h.stopPropagation(a)
            };
            J.f.dc ? (J.h.c(f, "touchstart", c, this), J.h.c(f, "touchmove", c, this), J.h.c(f, "touchend", c, this)) : (J.h.c(f, "mousedown", c, this), J.h.c(f, "mouseup", c, this), J.h.c(f, "mousemove", c, this))
        }
    },
    fr: function() {
        var a = this.get("isCustom"),
            b = this.get("showShadow");
        if (!a && b) {
            var a = this.Yk,
                b = J.a.Ak(this.td),
                c = b.height - 23,
                d = b.width;
            if (J.f.Xc || J.f.Ek) c = this.td.childNodes[0].offsetHeight,
                d = this.td.childNodes[0].offsetWidth + 26;
            b = "background-image:url(" + J.m.Ka + (J.f.Xc ? "/theme/v1.3/iws.gif);": "/theme/v1.3/iws.png);");
            a.innerHTML = "";
            var f = [],
                g;
            g = f[1] = {};
            g.height = 0.5 * c + 4;
            g.width = d;
            g.offsetX = 400;
            g.offsetY = 16;
            g.top = -g.height - 10 - 15;
            g.left = 23;
            g = f[2] = {};
            g.height = f[1].height;
            g.width = f[1].height;
            g.offsetX = 1075 - g.width;
            g.offsetY = f[1].offsetY;
            g.top = f[1].top;
            g.left = 23 + f[1].width;
            g = f[3] = {};
            g.height = 10;
            g.width = 22;
            g.offsetX = 30;
            g.offsetY = 445;
            g.top = -25;
            g.left = 23 + (J.f.Ek || J.f.Xc ? 5 : 0);
            g = f[4] = {};
            g.height = 10;
            g.width = d / 2 - 15 - f[3].left - f[3].width;
            g.offsetX = 132;
            g.offsetY = 445;
            g.top = -25;
            g.left = f[3].left + f[3].width;
            g = f[5] = {};
            g.height = 10;
            g.width = 70;
            g.offsetX = 80;
            g.offsetY = 445;
            g.top = -25;
            g.left = f[4].left + f[4].width;
            g = f[6] = {};
            g.height = 10;
            g.width = d - f[5].left - f[5].width;
            g.offsetX = 132;
            g.offsetY = 445;
            g.top = -25;
            g.left = f[5].left + f[5].width;
            g = f[7] = {};
            g.height = 10;
            g.width = 30;
            g.offsetX = 621;
            g.offsetY = 445;
            g.top = -25;
            g.left = d;
            g = f[8] = {};
            g.height = 15;
            g.width = 70;
            g.offsetX = 47;
            g.offsetY = 470;
            g.top = -15;
            g.left = d / 2 - 15;
            for (c = 1; 8 >= c; c += 1) d = J.a.create("div", a),
                g = [],
                g.push("position:absolute;"),
                g.push(b),
                g.push("top:" + f[c].top + "px;"),
                g.push("left:" + f[c].left + "px;"),
                g.push("width:" + f[c].width + "px;"),
                g.push("height:" + f[c].height + "px;"),
                g.push("background-position:" + -f[c].offsetX + "px " + -f[c].offsetY + "px;"),
                d.style.cssText = g.join("")
        }
    },
    zK: function() {},
    sg: function() {
        var a = this.map,
            b = this.Aa,
            c = this.get("position"),
            d = this.get("resolution");
        if (a && b && c) {
            var c = a.zb(this.get("position")),
                f = this.get("centerCoords"),
                b = (c.x - f.x) / d,
                d = (c.y - f.y) / d,
                a = a.get("size"),
                c = J.a.Ak(this.td);
            if (J.f.Xc || J.f.Ek) c.width = this.td.childNodes[0].offsetWidth + 14;
            c = this.get("isCustom") ? c.width / 2 : (c.width - 30) / 2;
            this.Aa.style.left = b + a.width / 2 - c + "px";
            this.Aa.style.top = d + a.height / 2 + "px";
            b = this.UC;
            if (this.ap && b.childNodes[0]) {
                for (d = a = 0; d < b.childNodes.length; d += 1) a += b.childNodes[0].clientHeight || 0;
                a > (this.get("size").height || b.clientHeight) ? this.ap.style.right = "20px": this.ap.style.right = "5px"
            }
        }
    },
    jz: function() {
        var a = new J.C(2 - this.td.offsetWidth / 2, 2 - this.td.offsetHeight),
            b = this.get("offset") || new J.C(0, 0);
        this.get("isCustom") || (a = a.add(new J.C(0, -23)));
        return a.add(b)
    },
    ds: function() {
        if (this.get("position") && this.get("autoMove") && this.td) {
            var a = this.map,
                b = new J.Hb(this.td.offsetWidth, this.td.offsetHeight);
            a.$p(this.get("position"));
            for (var c = a.$p(this.get("position")).add(this.jz()), d = c.add(b.al()), f = a.get("size"), g = a.HD(), h = 0, k = 0, l = 0; l < g.length; l += 1) {
                var m = g[l],
                    n = 0,
                    q = 0;
                0 === m[1] && 0 === m[2] ? (n = m[3] - (c.x + h), q = m[0] - (c.y + k), 0 < n && 0 < q && (Math.abs(n) < Math.abs(q) ? h += n: k += q)) : 0 === m[2] && 0 === m[3] ? (n = f.yd() - m[1] - (d.x + h), q = m[0] - (c.y + k), 0 > n && 0 < q && (Math.abs(n) < Math.abs(q) ? h += n: k += q)) : 0 === m[0] && 0 === m[3] ? (n = f.yd() - m[1] - (d.x + h), q = f.xd() - m[2] - (d.y + k), 0 > n && 0 > q && (Math.abs(n) < Math.abs(q) ? h += n: k += q)) : 0 === m[0] && 0 === m[1] && (n = m[3] - (c.x + h), q = f.xd() - m[2] - (d.y + k), 0 < n && 0 > q && (Math.abs(n) < Math.abs(q) ? h += n: k += q))
            }
            c = c.add(new J.C(h, k));
            d = d.add(new J.C(h, k));
            l = g = 0;
            0 > c.x || b.yd() > f.yd() ? g = 20 - c.x: f.yd() < d.x && (g = f.yd() - d.x - 25);
            0 > c.y || b.xd() > f.xd() ? l = 5 - c.y: f.xd() < d.y && (l = f.xd() - d.y - 15);
            g += h;
            l += k; (g || l) && a.Sb.panBy(g, l)
        }
    },
    RC: function() {
        this.get("closeWhenClickMap") && this.map.c("closeInfo", this.os, this, !1)
    },
    os: function() {
        this.Tf.Oe && this.Tf.close()
    },
    jg: function() {
        this.Aa && (this.get("retainWhenClose") ? this.map.Hi.appendChild(this.Aa) : this.Aa.parentNode === this.map.ua.ba && this.map.ua.ba.removeChild(this.Aa), this.Tf.Oe = !1, this.Tf.Rd.map = null, this.Tf.map = null, this.hc.k("close", {
            type: "close",
            target: this.hc
        }))
    },
    WH: function() {
        if (!this.get("isCustom")) return this.td.offsetWidth;
        for (var a = this.Sd,
                 b = a.firstChild,
                 c = a.lastChild; b && c && b.style && c.style && b === c;) a = b,
            b = a.firstChild,
            c = a.lastChild;
        a = J.a.Kb(a, "width");
        return a = parseInt(a.replace("px", ""), 10)
    },
    displayChanged: function(a) {
        a ? this.sg() : J.e.ni(this.sg, this)
    },
    positionChanged: function() {
        this.map && this.Aa && (this.sg(), this.ds())
    },
    offsetChanged: function() {
        var a = this.get("offset");
        this.Wb.style.bottom = -1 * (a.y || 0) + "px";
        this.Wb.style.left = (a.x || 0) + "px";
        this.Yk.style.bottom = -1 * (a.y || 0) + "px";
        this.Yk.style.left = (a.x || 0) + "px"
    },
    contentChanged: function() {
        this.yj();
        this.fr();
        this.sg()
    },
    sizeChanged: function() {
        this.yj();
        this.fr();
        this.sg()
    }
});
J.R = {};
J.R.Ej = J.P.extend({
    pb: [J.ga, J.Nc],
    o: function() {},
    gb: function() {
        return new this.o(this.Pa)
    },
    tp: function() {
        return this.Pa
    },
    setCoords: function(a) {
        this.xG(a)
    },
    xG: function(a) {
        this.gi = this.Ub();
        this.Ic = null;
        if (J.R.Pc && this instanceof J.R.Pc) {
            var b = a.length;
            this.ae = Array(b);
            for (var c, d, f = 0; f < b; f += 1) if (c = a[f], d = new J.R.Ar(c), this.ae[f] = d, 0 === f) {
                if (0 === c.length) break;
                d.Zh(c) || c.reverse()
            } else 0 !== c.length && d.Zh(c) && c.reverse()
        } else this.Pa = a
    }
});
J.R.Db = J.extend({},
    {
        Ai: "point",
        nn: "linestring",
        yr: "linearring",
        sl: "polygon",
        rn: "multipoint",
        qn: "multilinestring",
        rl: "multipolygon",
        FH: "geometrycollection"
    });
J.ge = J.P.extend({
    pb: [J.ga, J.Nc],
    o: function(a) {
        a = a || {};
        this.io = a.io;
        this.map = a.map;
        this.sm = J.e.Cb(this);
        this.name = a.name || "";
        this.Pe = !1;
        this.set("visible", !0, !0);
        this.yG(a.ta);
        this.ee = a.an;
        this.style = a.style
    },
    jD: function() {
        this.style = this.ee = this.Ih = this.ta = this.name = this.map = null;
        this.jn();
        this.nk()
    },
    cE: function() {
        return this.ee
    },
    CG: function(a) {
        this.ee = a;
        this.zIndex = this.ee[0].Qd || this.zIndex
    },
    YI: function() {
        return this.ta
    },
    yG: function(a) {
        a && (this.ta = a, this.D("coords", a, !0), this.io && (a.D("radius", this), a.D("center", this), a.D("resolution", this), a.D("strokeWeight", this)))
    },
    setStyle: function(a) {
        this.CG(a);
        this.Ug()
    },
    coordsChanged: function() {
        this.Ug()
    },
    radiusChanged: function() {
        this.ta.gi = this.ta.Ub();
        this.ta.Ic = null;
        this.Ug()
    },
    Ug: function(a) {
        this.set("feature", {
            target: this,
            fD: a,
            gi: this.ta.gi || this.ta.Ub(),
            dF: this.ta.Ub()
        });
        this.ta.gi = this.ta.Ub()
    },
    visibleChanged: function() {
        this.Ug()
    },
    gJ: function(a) {
        for (var b = 0; b < this.ee.length; b += 1) {
            var c = this.ee[b];
            if (a.xb(c.Yi(this))) return c
        }
    },
    JD: function() {
        var a = this.ta,
            b = [];
        a.kd() === J.R.Db.sl || a.kd() === J.R.Db.rl ? b.push(new J.style.ub.Pc({
            fillColor: "#78cdd1",
            cc: 0.2,
            strokeColor: "#122e29",
            fa: 0.5,
            Ua: 1
        })) : a.kd() === J.R.Db.nn || a.kd() === J.R.Db.yr || a.kd() === J.R.Db.qn ? b.push(new J.style.ub.zr({
            color: "#888888",
            width: 1,
            zIndex: 10
        })) : a.kd() !== J.R.Db.Ai && a.kd() !== J.R.Db.rn || b.push(new J.style.ub.ql({
            url: J.m.Ka + "/theme/v1.3/markers/0.png",
            width: 36,
            height: 36,
            rotation: 0,
            NK: -12,
            OK: -36,
            zIndex: 100
        }));
        return b
    }
});
J.ge.BH = "geometry";
J.R.fd = J.R.Ej.extend({
    o: function(a, b) {
        this.Pa = a;
        this.cg = b;
        this.Ic = null
    },
    Ub: function() {
        if (!this.Ic) {
            var a = this.Pa[0],
                b = this.Pa[1];
            if (this.cg) this.Ic = [a, b, a, b];
            else {
                var c = this.get("radius"),
                    c = c ? c / Math.cos(Math.PI * this.get("center").w / 180) : 0,
                    d = this.get("resolution") * this.get("strokeWeight") || 0;
                this.Ic = [a - c - d, b - c - d, a + c + d, b + c + d]
            }
        }
        return this.Ic
    },
    kd: function() {
        return J.R.Db.Ai
    }
});